/**
 * @copyright 2017 sinping.com 北京芯平科技股份有限公司. All rights reserved.
 * 本内容仅限于北京芯平科技股份有限公司内部传阅，禁止外泄以及用于其他的商业目的.
 */
package com.sinping.qh.dto.auth;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 用户缓存Redis 对象
 *
 * @author guojie
 * @create 2017/12/21
 */
public class UserSessionDTO implements Serializable {

    private static final long serialVersionUID = 3109270723229406104L;
    //  用户资源  key=url value =[ permission]
    private Map<String, String[]> urlResoure = new HashMap<String, String[]>();
    //用户名称
    @JsonProperty(value = "user_name")
    private String username;
    //用户id
    @JsonProperty(value = "user_id")
    private String id;
    // 用户登录token
    private String token;
    // 用户别名
    private String nickname;

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Map<String, String[]> getUrlResoure() {
        return urlResoure;
    }

    public void setUrlResoure(Map<String, String[]> urlResoure) {
        this.urlResoure = urlResoure;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }



    public UserSessionDTO() {
    }

    public UserSessionDTO(Map<String, String[]> urlResoure, String username, String id, String token, String nickname) {
        this.urlResoure = urlResoure;
        this.username = username;
        this.id = id;
        this.token = token;
        this.nickname = nickname;
    }

    @Override
    public String toString() {
        return "UserSessionDTO{" +
                "urlResoure=" + urlResoure +
                ", username='" + username + '\'' +
                ", id='" + id + '\'' +
                ", token='" + token + '\'' +
                ", nickname='" + nickname + '\'' +
                '}';
    }
}
